﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace Cqrs.Infrastructure.Aggregate
{

    public class State
    {

        // This is a collection of events, with the resulting state that would occur.
        private readonly Dictionary<string, string> _transitions =
            new Dictionary<string, string>();

        public State(string name)
        {
            this.Name = name;
        }

        public string Name { get; private set; }

        [JsonIgnore]
        public Dictionary<string, string> Transitions
        {
            get
            {
                return _transitions;
            }
        }
        
        
        public void AddTransition(Type @event, State state)
        {
            _transitions.Add(@event.Name,
                state.Name);
        }
    }
}
